package application.model 
{
	import application.ApplicationFacade;
	import application.model.VO.ModuleNavVO;
	import application.model.VO.ModuleVO;
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.proxy.Proxy;
	/**
	 * ...
	 * @author Ning
	 */
	public class ModuleProxy extends Proxy implements IProxy
	{
		public static const NAME:String = 'ModuleProxy';
		
		private var _layoutProxy:LayoutProxy;
		private var _moduleNavProxy:ModuleNavProxy;
		public function ModuleProxy() 
		{
		    super(NAME, new ModuleVO)
			_layoutProxy = facade.retrieveProxy(LayoutProxy.NAME) as LayoutProxy;
			_moduleNavProxy = facade.retrieveProxy(ModuleNavProxy.NAME) as ModuleNavProxy;
		}
		private function get moduleVO():ModuleVO {
			return data as ModuleVO;
		}
		public function setConfig():void
		{
			moduleVO.layout = _layoutProxy.getLayout(AppGlobal.MODULE_LAYOUT_KEY);
			moduleVO.names = _moduleNavProxy.names;
			moduleVO.width = Number(AppGlobal.CONFIG_XML.modules.@['width']);

			sendNotification(ApplicationFacade.UPDATE_MODULE_DATA, moduleVO);
		}
	}

}